<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
	<input type="hidden" value="${pageTotalNum}" id="TotalNum"/><!-- 保存查训结果页数 -->
	<select id="CategorySelect" onchange="selectCategory('CategorySelect',1)">
		<c:forEach items="${bookCategory}" var="cty">
			<c:choose>
			 	<c:when test="${categoryid==cty.id}">
					    <option value="${cty.id}" selected = "selected">${cty.name}</option>
				</c:when>
				<c:otherwise>
					    <option value="${cty.id}">${cty.name}</option>
				</c:otherwise>
			</c:choose>
		</c:forEach>
	</select>
	<table id="booktab">
		<tr>
			<th>选择</th>
			<th>书名</th>
			<th>作者</th>
			<th>出版社</th>
			<th>出版日期</th>
			<th>售价</th>
			<th>点击量</th>
			<th>种类</th>
			<th>操作</th>
		</tr>

		<c:forEach items="${books}" var="book">
			<tr>
				<td><input type="checkbox" value="${book.id }" /></td>
				<td>${book.title}</td>
				<td>${book.author}</td>
				<td>${book.publish.name}</td>
				<td>${book.publishDate}</td>
				<td>${book.unprice}</td>
				<td>${book.clicks}</td>
				<td>${book.category.name}</td>
				<td><a
					href="#" onclick="doBookInfo(${book.id})">修改</a><!-- 用ajax执行请求 --> <a
					href="#" onclick="deleteBook(${book.id})">删除</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<div id="RJ-pagebar" class="RU-pagebar"></div>
	<div id="mark"></div>
	<input type="button" onclick="deleteBooks('booktab')" value="删除选中" />

